package com.biz.primus.ms.commodity.trans.searchRecommendword;

import com.biz.primus.commodity.vo.backend.searchRecommendWord.SearchRecommendWordVo;
import com.biz.primus.common.utils.StringUtil;
import com.biz.primus.ms.commodity.dao.po.SearchRecommendWord;
import com.google.common.base.Function;
import com.google.common.base.Strings;

public class SearchRecommendWordVo2SearchRecommendWord implements Function<SearchRecommendWordVo, SearchRecommendWord> {

	@Override
	public SearchRecommendWord apply(SearchRecommendWordVo input) {
		SearchRecommendWord resp = new SearchRecommendWord();
		if(!Strings.isNullOrEmpty(input.getWordId())){
			resp.setId(Long.valueOf(input.getWordId()));
		}
		resp.setIdx(input.getIdx());
		resp.setNote(StringUtil.patternMatcherStr(input.getNote()));
		resp.setSearchName(input.getSearchName());
		return resp;
	}

}
